package edu.gdut.thesissys.vo;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * NetTeaching entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "net_teaching", catalog = "gdutmis")
public class NetTeaching extends BaseVo implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4945220310287698265L;
	// Fields

	private Integer questionId;
	private Student student;
	private String titleId;
	private String question;
	private String answer;
	private Date askDate;
	private Date answerDate;
	private String state;

	// Constructors

	/** default constructor */
	public NetTeaching() {
	}

	/** minimal constructor */
	public NetTeaching(Student student, String titleId, String question,
			Date askDate, String state) {
		this.student = student;
		this.titleId = titleId;
		this.question = question;
		this.askDate = askDate;
		this.state = state;
	}

	/** full constructor */
	public NetTeaching(Student student, String titleId, String question,
			String answer, Date askDate, Date answerDate, String state) {
		this.student = student;
		this.titleId = titleId;
		this.question = question;
		this.answer = answer;
		this.askDate = askDate;
		this.answerDate = answerDate;
		this.state = state;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "question_id", unique = true, nullable = false)
	public Integer getQuestionId() {
		return this.questionId;
	}

	public void setQuestionId(Integer questionId) {
		this.questionId = questionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "student_id", nullable = false)
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Column(name = "title_id", nullable = false, length = 6)
	public String getTitleId() {
		return this.titleId;
	}

	public void setTitleId(String titleId) {
		this.titleId = titleId;
	}

	@Column(name = "question", nullable = false, length = 65535)
	public String getQuestion() {
		return this.question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	@Column(name = "answer", length = 65535)
	public String getAnswer() {
		return this.answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ask_date", nullable = false, length = 10)
	public Date getAskDate() {
		return this.askDate;
	}

	public void setAskDate(Date askDate) {
		this.askDate = askDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "answer_date", length = 10)
	public Date getAnswerDate() {
		return this.answerDate;
	}

	public void setAnswerDate(Date answerDate) {
		this.answerDate = answerDate;
	}

	@Column(name = "state", nullable = false, length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

}